<?php

/**
 * Diagnostico form.
 *
 * @package    form
 * @subpackage Diagnostico
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
 */
class DiagnosticoForm extends BaseDiagnosticoForm
{
	protected function initialize()
	{
		$this->labels = array
		                (
                          'historia_clinica_id' => 'Historia Clinica',
                          'doctor_id'           => 'Doctor',
                          'servicio_medico_id'  => 'Servicio Medico',
                          'descripcion'         => 'Descripcion',
                          'estado'              => 'Estado',
                          'sintomas_list'       => 'Sintomas',
                          'enfermedades_list'   => 'Enfermedades',
		                );
	}
  public function configure()
  {
  	$this->setWidgets(array
  	(
  	  'id'                  => new sfWidgetFormInputHidden(),
      'historia_clinica_id' => new sfWidgetFormValue(array('value' => $this->getObject()->getHistoriaClinica()->getCodigo())),
      'doctor_id'           => new sfWidgetFormDoctrineSelect
                             (
                               array
                               (
                                 'model'     => 'Doctor', 
                                 'add_empty' => '---Seleccionar---', 
                                 'order_by'  => array('Nombres', 'asc')
                               )
                             ),
      'servicio_medico_id'  => new sfWidgetFormDoctrineSelect
                             (
                               array
                               (
                                 'model'     => 'ServicioMedico', 
                                 'add_empty' => '---Seleccionar---', 
                                 'order_by'  => array('Nombre', 'asc')
                               )
                             ),
      'descripcion'         => new sfWidgetFormTextarea(),
      'estado'              => new sfWidgetFormSelect(array('choices' => $this->getTable()->getEstado())),
      'sintomas_list'       => new sfWidgetFormDoctrineChoiceMany
                            (
                              array
                              (
                                'model'            => 'Sintoma',
                                'renderer_class'   => 'sfWidgetFormSelectDoubleList',  //sfDoubleList
                                'renderer_options' => array
                                                      (
                                                        'label_associated'   => 'Posibles Sintomas',
                                                        'label_unassociated' => 'Mis Sintomas'
                                                      )
                              )
                            ),
      'enfermedades_list'   => new sfWidgetFormValue(array('value' => 'Click aqu&iacute; para buscar enfermedades en t&iacute;.<br><br>')),
  	));

  	$this->types = array
  	(
  	  'id'                  => '=',
      'historia_clinica_id' => '-',
      'doctor_id'           => array('combo', array()),
      'servicio_medico_id'  => array('combo', array()),
      'descripcion'         => 'text',
      'estado'              => array('combo', array('choices' => array_keys($this->getObject()->getTable()->getEstado()))),
      'created_at'          => '-',
      'updated_at'          => '-',
      'sintomas_list'       => 'pass',
      'enfermedades_list'   => '-',
  	);
  }
}